﻿@model SMECustomerWebsite.Models.ViewModels.DaoManager.DaoInfoViewModel
@using Common.Data.Repository.Enum;
@using Common.Data;
<div class="right_col sme_body register_body" role="main">
    <section class="content-wrapper main-content clear-fix">
        <div id="wrapper">
            <section class="login_content">
                <img class="logovpb-login" src="~/Images/LOGO/logo-ngang.png" alt="">
                @using (Html.BeginForm("DaoRegistrationRequestByGuest", "DaoManager", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal form-label-left", novalidate = "novalidate" }))
                {
                    List<SelectListItem> listPostion = new List<SelectListItem>();
                    listPostion.Add(new SelectListItem
                    {
                        Text = "--- Chọn lý do ---",
                        Value = "",
                        Selected = true
                    });
                    var listEnum = Enum.GetValues(typeof(SMESalePositionEnum)).Cast<SMESalePositionEnum>().ToList();
                    listEnum.ForEach(x =>
                    {
                        listPostion.Add(new SelectListItem
                        {
                            Text = EnumHelper<SMESalePositionEnum>.GetDisplayValue(x),
                            Value = x.ToString(),
                            Selected = false
                        });
                    });
                    <h1>MẪU ĐĂNG KÝ</h1>
                    @Html.AntiForgeryToken()
                    @Html.ValidationSummary(true)
                    if (@Model.MessageType != null && Model.MessageType == Common.Type.MessageType.Error)
                    {
                        <div class="alert alert-danger alert-dismissible fade in" role="alert">
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                <span aria-hidden="true">×</span>
                            </button>
                            @Model.Message
                        </div>
                    }
                    <div class="item form-group">
                        @Html.TextBoxFor(m => m.FullName, new { @class = "form-control", placeholder = "Họ và tên", required = "required" })
                    </div>
                    <div data-toggle="tooltip" data-placement="right" title="" data-original-title="" class="item form-group">
                        @Html.DropDownListFor(m => m.PositionName, listPostion, new { @class = "form-control branch_register", @id = "position_name", placeholder = "Chức danh", required = "required" })
                        @*@Html.TextBoxFor(m => m.PositionName, new { @class = "form-control", placeholder = "Chức danh", required = "required" })*@
                    </div>
                    <div data-toggle="tooltip" data-placement="right" title="" data-original-title="Bộ phận Nhân sự cấp" class="item form-group">
                        @Html.TextBoxFor(m => m.StaffId, new { @class = "form-control", placeholder = "Mã nhân viên", required = "required" })
                    </div>
                    <div class="item form-group">
                        @Html.TextBoxFor(m => m.Email, new { @class = "form-control", placeholder = "Email VPBank", required = "required", type = "email" })
                    </div>
                    <div class="item form-group">
                        @Html.TextBoxFor(m => m.Cif, new { @class = "form-control", placeholder = "Mã CIF", required = "required" })
                    </div>
                    <div class="item form-group">
                        @Html.TextBoxFor(m => m.LegalId, new { @class = "form-control", placeholder = "CMND", required = "required" })
                    </div>
                    <div class="item form-group">
                        @Html.TextBoxFor(m => m.Phone, new { @class = "form-control", placeholder = "Số điện thoại", required = "required", type = "tel", data_validate_length_range = "8,20" })
                    </div>
                    <div class="item form-group">
                        @Html.DropDownListFor(m => m.Branch, Model.ListBranch, new { @class = "form-control branch_register", @id = "branch_register", placeholder = "Chi nhánh", required = "required" })
                    </div>
                    <div data-toggle="tooltip" data-placement="right" title="" data-original-title="Thư mời làm việc, , chỉ chấp nhận file ảnh hoặc pdf" class="item form-group">
                        @Html.TextBoxFor(m => m.File, new { @class = "form-control", type = "file", placeholder = "Thư mời làm việc" })
                    </div>
                    <div>
                        <input type="submit" class="btn btn-default submit" value="Register" />
                        <a class="reset_pass" href="/Account/login">Already existing user</a>
                    </div>
                    <div class="clearfix"></div>
                    <div class="separator">
                        <div class="clearfix"></div>
                        <br />
                        <div class="col-lg-12">
                            <img class=" col-lg-4 col-md-8 col-sm-12 logobic-sidebar" src="~/Images/LOGO/BICC_New Logo_Transparent Background.png" alt="">
                            <img class="col-lg-8 col-md-8 col-sm-12" src="~/Images/LOGO/logo-VPBank-SME-ok-2.png" alt="">
                        </div>
                        <h1>
                            <br /> SMEs Customer 360 Degree
                        </h1>
                        <p>©2016 All Rights Reserved. Privacy and Terms</p>
                    </div>
                }
            </section>
        </div>
    </section>
</div>
@section scripts
{
    <script src="~/Scripts/tableeditable/dataTables.rowsGroup.js"></script>
    <!-- validator -->
    <script src="~/Scripts/vendors/validator/validator.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#position_name').select2({
                placeholder: 'Chọn vị trí'
            });
            $('#branch_register').select2({
                placeholder: 'Chọn trung tâm'
            });
        })
    </script>

    <!-- validator -->
    <script>
        // initialize the validator function
        validator.message.date = 'not a real date';

        // validate a field on "blur" event, a 'select' on 'change' event & a '.reuired' classed multifield on 'keyup':
        $('form')
          .on('blur', 'input[required], input.optional, select.required', validator.checkField)
          .on('change', 'select.required', validator.checkField)
          .on('keypress', 'input[required][pattern]', validator.keypress);

        $('.multi.required').on('keyup blur', 'input', function () {
            validator.checkField.apply($(this).siblings().last()[0]);
        });

        $('form').submit(function (e) {
            e.preventDefault();
            var submit = true;

            // evaluate the form using generic validaing
            if (!validator.checkAll($(this))) {
                submit = false;
            }

            if (submit)
                this.submit();

            return false;
        });
    </script>
    <!-- /validator -->
}
